1. Field of the Invention
The present invention relates to an image processing apparatus and a control method therefor, and more particularly to an image processing apparatus for performing white balance correction on captured images and a control method therefor.
2. Description of the Related Art
Heretofore, image capturing apparatuses such as digital still cameras, for example, have been provided with an automatic white balance function for automatically performing white balance correction on captured images. In order to reduce variation in white balance correction results of continuously captured images, application of a white balance correction value computed based on the image captured in the first frame (first image) to the second frame (second image) onward during continuous shooting is known.
However, in the case where the color temperature of light illuminating the subject during continuous shooting changes, this method may result in the color of images captured before and after the change being different. In order to solve this problem, Japanese Patent Laid-Open No. 2002-247590 (Literature 1) discloses a technique that involves measuring the luminance of the subject for every image obtained by continuous shooting, and computing a new white balance correction value according to the amount of change between the luminance of the subject in the image of the previous frame and the luminance of the subject in the image of the current frame.
With the technique described in Literature 1, if the color temperature of light illuminating the subject does not change during continuous shooting (little change in luminance), the white balance correction value applied to the image of the previous frame is applied to the image of the current frame. Thus, variation in the white balance correction results of continuously captured images can be reduced. If the color temperature of light illuminating the subject changes during continuous shooting (significant change in luminance), a white balance correction value computed based only on the image of the current frame is applied to the image of the current frame. Thus, even if the color temperature of light illuminating the subject changes between shooting of the previous frame and the current frame, an appropriate white balance correction result is obtained for the image of the current frame.
However, in the technology disclosed by Literature 1, an appropriate automatic white balance correction result may not be obtained in the following two examples.
The first example is where the image capturing area gradually changes from a sunny area to a shaded area during continuous shooting such as shown in FIG. 3. Reference numeral 301 denotes the image capturing area of the first frame at the time of continuous shooting, and 302 to 306 respectively the image capturing areas of the second to sixth frames at the time of continuous shooting. In the case where the proportion of the area that a plurality of light sources occupies in the captured images gradually changes in this manner, there is little change in luminance between the current frame and the previous frame. Thus, change in the light sources cannot be appropriately detected with the method of Literature 1. As a result, the white balance correction value for the sunny area computed with the first frame 301 is used sequentially, and even ends up being used for shooting the shaded area of the sixth frame 306.
The second example is where the state of a person in continuously captured images changes such as shown in FIG. 4A and FIG. 4B, in an image capturing apparatus that has a face detection function and performs white balance correction so as to achieve an appropriate facial skin color when a face is detected. Reference numerals 401 and 402 denote the same scene, and 403 to 405 the image capturing areas of the first to third frames. The person is facing the front in scene 401, whereas the person has turned to the side in scene 402.
Here, since the person appears facing the front in the first frame 403, face detection detects the person's face. Automatic white balance correction to achieve an appropriate facial skin color is executed on the basis of color information of the detected face. A more accurate white balance correction result than the case where face detection is not performed can thereby be obtained.
Since the area captured in the second frame 404 is completely different from the first frame 403, with sky notably being included in the area, there is a significant change in luminance from the first frame 403. Accordingly, with the method described in Literature 1, white balance correction of the second frame 404 is performed based only on the image of the second frame.
When the same image capturing area as the first frame 403 is again captured in the third frame 405, white balance correction on the third frame 405 is executed also based only on the image of the third frame 405, since there is a significant change in luminance from the second frame 404. Here, it is assumed that the person's face could not be detected in the third frame 405, since the person was facing to the side. In this case, unlike the first frame 403 in which the person's face could be detected, white balance correction is performed in the third frame 405 without using the color information of the face.
As a result, the white balance correction values of the first frame 403 obtained using the color information of the face and the third frame 405 obtained without using the color information of the face will differ, resulting in images with different hues despite the image capturing areas of the first frame 403 and the third frame 405 being substantially the same.